package cn.edu.ccibe.exam16system.entity;

import lombok.*;

import java.util.ArrayList;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
public class DormitoryDto extends Dormitory {

    private List<Student> students;

    public DormitoryDto(Dormitory dormitory) {
        this.setDormId(dormitory.getDormId());
        this.setDormNumber(dormitory.getDormNumber());
        this.setImage(dormitory.getImage());
        this.setDormType(dormitory.getDormType());
        this.setTotalBeds(dormitory.getTotalBeds());
        this.setOccupiedBeds(dormitory.getOccupiedBeds());
        this.setAvailableBeds(dormitory.getAvailableBeds());
        this.setBuilding(dormitory.getBuilding());
        this.setFloor(dormitory.getFloor());
        this.setManager(dormitory.getManager());
        this.students = new ArrayList<>();
    }
}
